package com.csun.cmny.provider.service.impl;

import com.csun.cmny.provider.dao.CacMinorItemMapper;
import com.csun.cmny.provider.pojo.CacMinorItem;
import com.csun.cmny.provider.service.CacMinorItemService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("CacMinorItemService")
public class CacMinorItemServiceImpl implements CacMinorItemService {
    @Resource
    CacMinorItemMapper cacMinorItemMapper;

    @Override
    public int insert(CacMinorItem cacMinorItem) {
        return cacMinorItemMapper.insertSelective(cacMinorItem);
    }

    @Override
    public int update(CacMinorItem cacMinorItem) {
        return cacMinorItemMapper.updateByPrimaryKeySelective(cacMinorItem);
    }

    @Override
    public CacMinorItem selectCmiById(Integer minorItemId) {
        return cacMinorItemMapper.selectByPrimaryKey(minorItemId);
    }

    @Override
    public int delById(Integer minorItemId) {
        return cacMinorItemMapper.deleteByPrimaryKey(minorItemId);
    }

    @Override
    public CacMinorItem selectByCmi(CacMinorItem cacMinorItem) {
        return cacMinorItemMapper.selectByCmi(cacMinorItem);
    }

    @Override
    public int delByBid(Integer bigItemId) {
        return cacMinorItemMapper.delByBid(bigItemId);
    }

    @Override
    public int delByTypeId(Integer cacTypeId) {
        return cacMinorItemMapper.delByTypeId(cacTypeId);
    }

    @Override
    public int insertBatch(List<CacMinorItem> cacMinorItemList) {
        return cacMinorItemMapper.insertBatch(cacMinorItemList);
    }
}
